home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group97b.txt
/
000118_icon-group-sender _Wed Nov 12 16:25:11 1997.msg
< prev
next >
Wrap
Internet Message Format
|
2000-09-20
|
2KB
Return-Path: <icon-group-sender>
Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239])
by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id QAA07730
for <icon-group-addresses@baskerville.CS.Arizona.EDU>; Wed, 12 Nov 1997 16:25:11 -0700 (MST)
Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM)
id AA07668; Wed, 12 Nov 1997 16:25:11 -0700
From: gep2@computek.net
Date: Wed, 12 Nov 1997 14:14:34 -0600
Message-Id: <199711122014.OAA02574@axp.cmpu.net>
Mime-Version: 1.0
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Subject: Regular Expressions
To: icon-group@optima.CS.Arizona.EDU
X-Mailer: SPRY Mail Version: 04.00.06.17
Errors-To: icon-group-errors@optima.CS.Arizona.EDU
Status: RO
>For part of a class project I need/like to be able to find all
occanses of a Regular Expression in a ASCII file. Icon seams that is might
be good for this, since one can fine all occurance of a word easly.
The problem is that RegExes are a truly braindead way to express a pattern, and
although RegExes were inspired by SNOBOL4 (which also inspired Icon, of course)
the RegEx thing is really in a number of ways a different beast than a
full-fledged pattern match or string scan like you'd do with SNOBOL4/SPITBOL or
Icon, respectively.
If you're looking for something, S*BOL or Icon either one go *way* beyond what
you might reasonably hope to do with RegExes.
>So how would one go about this?
Do you HAVE to use RegExes? Or are S*BOL patterns or Icon string scanning
techniques acceptable alternatives?
>I'd like to be able to serach for the Reg. Exp. over line breaks if possable.
That's fairly trivial, one simple way to do it is to append pairs of consecutive
lines together prior to the match (assuming that a given match will not extend
across more than two lines...)
Gordon Peterson
http://www.computek.net/public/gep2/
Support the Anti-SPAM Amendment! Join at http://www.cauce.org/